﻿@using ViewRes
@using DonutMgmtSystemFoundation.Helpers

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width" />
    <title>@RenderSection("Title", true)</title>

    <link href="@Url.Content("~/css/common.css")" rel="stylesheet" />
    <style type="text/css">
        .ui.buttons .or:before
        {
            content: '@Shared.or' !important;
        }
    </style>
    @RenderSection("Styles", false)

    @Styles.Render("~/bundles/semantic")
    @Scripts.Render("~/bundles/semanticUI")

    @RenderSection("Scripts", false)

    <!--Google Analytics-->
    <script>
        (function (i, s, o, g, r, a, m) {
            i['GoogleAnalyticsObject'] = r; i[r] = i[r] || function () {
                (i[r].q = i[r].q || []).push(arguments)
            }, i[r].l = 1 * new Date(); a = s.createElement(o),
            m = s.getElementsByTagName(o)[0]; a.async = 1; a.src = g; m.parentNode.insertBefore(a, m)
        })(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');

        ga('create', 'UA-50789640-1', 'dmsf.azurewebsites.net');
        ga('send', 'pageview');

    </script>
    <!--End Google Analytics-->

    <script type="text/javascript">
        $(function () {
            $dropdown = $('.dropdown');

            $dropdown.dropdown({
                on: 'hover'
            });

            // Set Color for every menu element
            $("div.menu, div.menu > h2, div.menu > a").each(function (index) {
                $(this).addClass('inverted');
            });

            // Dropdown link actions
            $(".button-link").click(function () {
                var link = $(this).attr('data-link');
                window.location = (link);
            });

            $('.lang').popup({
                on: 'hover'
            });

            $(".lang").click(function () {
                var lang = $(this).attr('data-lang');

                window.location = ("@Url.Action("ChangeLanguage", "Language")?language=" + lang);
            });

        });

    </script>
</head>
<body>
    <div id="menu" class="ui menu">
        <div class="left menu">
            <h2 class="ui header">Donut Management System Foundation
            </h2>
        </div>
        <div class="right menu">
            <a href="@Url.Action("Index", "Home")" class="item">
                <i class="home icon"></i>@Shared.Home
            </a>
            <a href="@Url.Action("Index", "Calendar")" class="item">
                <i class="calendar icon"></i>@Shared.Calendar
                <a class="ui pointing dropdown item">
                    <i class="cart icon"></i>@Shared.Donuts <i class="dropdown icon"></i>
                    <div class="menu">
                        <div class="item button-link" data-link="@Url.Action("MyDonuts", "Donuts")">@Shared.MyDonuts </div>
                        <div class="item button-link" data-link="@Url.Action("Catalog", "Donuts")">@Shared.Catalog </div>
                        <div class="item button-link" data-link="@Url.Action("TeamDonuts", "Donuts")">@Shared.TeamDonuts </div>
                    </div>
                </a>
                <a class="item" href="@Url.Action("Index", "Profile")">
                    <i class="user icon"></i>@Shared.Profile
                </a>
                @if (SessionContext.GetUserData().Role.RoleId == 1)
                {
                    <a class="ui pointing dropdown item">
                        <i class="setting icon"></i>@Shared.Management <i class="dropdown icon"></i>
                        <div class="menu">
                            <div class="item button-link" data-link="@Url.Action("Members", "Admin")"><i class="users icon"></i>@Shared.Members </div>
                            <div class="item button-link" data-link="@Url.Action("ActivateUsers", "Admin")"><i class="users icon"></i>@Shared.ActivateUsers </div>
                            <div class="item button-link" data-link="@Url.Action("ChangeSettings", "Admin")"><i class="settings icon"></i>@Shared.ChangeParameters</div>
                            <div class="item button-link" data-link="@Url.Action("SendMails", "Admin")"><i class="mail icon"></i>@Shared.SendMail </div>
                        </div>
                    </a>
                }
                <a href="@Url.Action("Logout", "Login")" class="item">
                    <i class="sign out icon"></i>@Shared.Logout
                </a>
        </div>
    </div>
    <div class="ui right aligned grid">
        <div class="row">
            <div class="column">
                @Shared.Welcome, @SessionContext.GetUserData().Name
            </div>
        </div>
    </div>
    <div id="mainContent" class="ui one column grid">
        <div class="row">
            <div class="column">
                <h1 class="ui header">
                    @RenderSection("Pagename", false)
                </h1>
                @RenderSection("HeaderSection", false)
            </div>
        </div>
        <div class="row">
            <div class="column">
                @RenderBody()
            </div>
        </div>
    </div>
    <div class="ui right aligned grid">
        <div class="row">
            <div class="column">
                <div class="ui tiny floating buttons">
                    <div class="ui blue button lang" data-lang="en" data-content="@Shared.LangEnglish" data-position="bottom center" data-variation="inverted">@Shared.LangEng</div>
                    <div class="or"></div>
                    <div class="ui green button lang" data-lang="es-mx" data-content="@Shared.LangSpanish" data-position="bottom center" data-variation="inverted">@Shared.LangSp</div>
                </div>
            </div>
        </div>
    </div>
</body>
</html>
